package co.yixiang.mall.biz.commission.controller;

import co.yixiang.common.core.annotation.AnonymousAccess;
import co.yixiang.mall.biz.commission.service.RebateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rebate")
@EnableScheduling
public class RebateController {
    @Autowired
    RebateService rebateService;
    /**
     * 每月手动结算
     * */
    @AnonymousAccess
    @PostMapping("/close")
    public void rebate(){
        rebateService.closeAccount();
    }
    //@Scheduled(cron = "")
    public void rebateQz(){
        rebateService.closeAccount();
    }

}
